using Materal.Logger.Extensions;

namespace WorkerService1
{
    public class Program
    {
        public static async Task Main(string[] args)
        {
            HostApplicationBuilder builder = Host.CreateApplicationBuilder(args);
            builder.Services.AddHostedService<Worker>();
            builder.AddMateralLogger(true);
            // 添加Windows服务支持
            builder.Services.AddWindowsService(options =>
            {
                options.ServiceName = "WorkerService1";
            });
            IHost host = builder.Build();
            await host.RunAsync();
        }
    }
}